$(document).ready(function(){
$('#loginID').keyup(username_check);
});
	
function username_check(){	
var username = $('#loginID').val();
if(username == "" || username.length < 4){
$('#loginID').css('border', '3px #CCC solid');
$('#available').hide();
}else{
 
jQuery.ajax({
   type: "POST",
   url: "check.php",
   data: 'username='+ username,
   cache: false,
   success: function(response){
if(response == 1){
	$('#loginID').css('border', '3px #C33 solid');	
	$('#available').hide();
	$('#notavailable').fadeIn();
	}else{
	$('#loginID').css('border', '3px #090 solid');
	$('#notavailable').hide();
	$('#available').fadeIn();
	     }
 
}
});
} 
} 